$(function() {
    $(".topbar li.sitemap").each(function() {
        $(this).mouseenter(function() {
            $(this).addClass("menu-hover");
        })
        $(this).mouseleave(function() {
            $(this).removeClass("menu-hover");
        })
    });
    //登录缓存写读
    var userInfo = getCookie("userInfo");
    userLogin();

    function userLogin() {
        if (userInfo) {
            userInfo = JSON.parse(userInfo);
            $(".logon").show();
            $(".unlogin").hide();
            $(".user-name").text(userInfo._login_name);
        }
    }
    $(".header-nav-order").click(function() {
        if (!userInfo) {
            window.location.href = "https://www.56jiyun.com/jywl/login.htm/?mybackurl=https://www.56jiyun.com/delegate_order.html"
        } else {
            window.location.href = "https://www.56jiyun.com/delegate_order.html"
        }
    })
    $("#chengjiaodunwei").text("3500万+")
    $("#cheliangshu").text("210000+")
    $("#chuanboshu").text("1900+")
    $("#xinalushu").text("28000+")
    $("#chengyunshangshu").text("11000+")
});

//获取cookie
function getCookie(c_name) {
    var cookieValue = $.cookie(c_name);

    if (!cookieValue) {
        cookieValue = "";
    }

    return cookieValue;
}